﻿CREATE PROCEDURE [dbo].[utl_RemoveTimestampFromAllTables]

AS
BEGIN
	DECLARE @ID         INT
	DECLARE @TableName  sysname
	DECLARE @Tables     TABLE (ID INTEGER IDENTITY(1, 1) PRIMARY KEY, TableName sysname)
	
	INSERT INTO @Tables
	  (
	    TableName
	  )
	SELECT TableName
	FROM   dbo.fn_Tables()
	
	SELECT @ID = MIN(ID)
	FROM   @Tables
	
	WHILE @ID IS NOT NULL
	BEGIN
	    SELECT @TableName = TableName
	    FROM   @Tables
	    WHERE  ID = @ID
	    
	    EXECUTE [dbo].[utl_RemoveTimestamp] @TableName
	    
	    SELECT @ID = MIN(ID)
	    FROM   @Tables
	    WHERE  ID > @ID
	END
END

